function ThreadLocal() {

    //  ==========  global ==============
    // all customer has click
    this.allCustomerArray = [];
    // all customer has click
    this.customerHasNotClickedArray = [];
    this.personal_center_loopTotalTimes_max = 35;
    // wait max 5000 to show product list
    this.personal_center_showProductListWaitTime = 5000;
    // only like or not
    this.global_isLoveOrCollectArticle = false;

    //  ==========  global ==============


    // ========== local thread ==============
    this.currentAccountName = "";
    this.currentAccountId = 1;
    this.currentAccountNumber = 1;

    // attention list

    // is myself in attention list
    this.attention_list_isMyself = false;
    this.attention_list_currentNodeInfo = new NodeInfo(); // do not clear

    // personal center
    this.personal_center_topIsClicked = false;
    this.personal_center_topIsExist = false;
    this.personal_center_loopTotalTimes = 0;
    this.personal_center_hasFindRightProduct = true;
    this.personal_center_productToClick = null;

    // product detail

    // ========== local thread ==============


    this.clear = function () {
        this.attention_list_isMyself = false;
        this.currentAccountName = "";
        this.currentAccountId = 1;
        this.currentAccountNumber = 1;
        // this.attention_list_currentNodeInfo = new NodeInfo();
        this.personal_center_topIsClicked = false;
        this.personal_center_topIsExist = false;
        this.personal_center_loopTotalTimes = 0;
        this.personal_center_hasFindRightProduct = true;
        this.personal_center_productToClick = null;
    }

}


// 保存日志的文件路径
var global_log_filePath = "/sdcard/baishuiFile/";

beforeStartUp = function () {
    // 设置某个时间后，直接停止程序
    afterNeedToExit("20220415");

    // 判断是否进入无障碍模式
    if (!isAccMode()) {
        loge("请打开无障碍模式！！");
        exit();
    }
    // 按照每天的日期进行生成对应的文件名称
    setSaveLogEx(true, global_log_filePath, 1024 * 100, new Date().format("yyyy-MM-dd"));

    // 设置日志级别
    setLogLevel("debug", true);

    // 打印日志的时候，悬浮窗是否展示行号，正式发布，可以不展示行号，不影响调试和保存在文件的日志中
    setFloatDisplayLineNumber(false);

    setLogViewSizeByMySelf();

};

/**
 * 设置日志窗口大小扩展函数
 * @param map 例如
 *  {
 *      "x":100,
 *      "y":100,
 *      "w":100,
 *      "h":200,
 *      "textSize":12,
 *      "backgroundColor":"#ffffff",
 *      "title":"我是日志",
 *      "showTitle":true
 *  }
 *  解释：
 *      x: 起始X位置
 *      y: 起始Y位置
 *      w:宽度
 *      h:高度
 *      textSize:日志的字体大小
 *      backgroundColor:背景颜色，例如#336699
 *      title:日志框标题
 *      showTitle：是否显示标题
 *      backgroundImg 背景图片，放到工程的res文件夹，录入填写res/a.png
 * @return bool true代表成功，false代表失败
 */
setLogViewSizeByMySelf = function () {
    var map = {
        "x": 0,
        "y": 100,
        "w": 350,
        "h": 450,
        "textSize": 12,
        // "backgroundColor": "#333333",
        "title": "日志窗口",
        "showTitle": true
    };
    setLogViewSizeEx(map)
};


openServer = function () {
    try {
        var appName = "小红书"
        // 打开指定的应用程序
        utils.openAppByName(appName);
        logd("已经打开应用： " + appName);
        sleep(1000 * 10);
    } catch (e) {
        loge("小红书启动失败啦");
        exit();
    }
};


